<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>多选编辑</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
		
		<link rel="stylesheet" href="__JS__/kindeditor/themes/default/default.css" />
		<link rel="stylesheet" href="__JS__/kindeditor/plugins/code/prettify.css" />
		<script charset="utf-8" src="__JS__/kindeditor/kindeditor.js"></script>
		<script charset="utf-8" src="__JS__/kindeditor/lang/zh_CN.js"></script>
		<script charset="utf-8" src="__JS__/kindeditor/plugins/code/prettify.js"></script> 
		<script>
			KindEditor.ready(function(K) {
				var editor1 = K.create('textarea[name="name"]', {
					cssPath : '__JS__/kindeditor/plugins/code/prettify.css',
					uploadJson : '__JS__/kindeditor/php/upload_json.php?no=<?php echo ($no); ?>',
					fileManagerJson : '__JS__/kindeditor/php/file_manager_json.php?no=<?php echo ($no); ?>',
					allowFileManager : true,
					afterCreate : function() {
						var self = this;
						K.ctrl(document, 13, function() {
							self.sync();
							K('form[name=discuss]')[0].submit();
						});
						K.ctrl(self.edit.doc, 13, function() {
							self.sync();
							K('form[name=discuss]')[0].submit();
						});
					}
				});
				prettyPrint();
			});
		</script>
		<script type="text/javascript" src="__JS__/jshelper.js"></script> 
		<script type="text/javascript" src="__JS__/jQuery/jquery.js"></script>
       	<script type="text/javascript" src="__JS__/jQuery/jquery.form.js"></script>
       	<script>
		  $(function(){
           $('#form1').ajaxForm({
				//beforeSubmit:  function(){alert("before");},  // pre-submit callback
				success:       complete,  // post-submit callback
				error:function(){alert("error");},
				dataType: 'json'
			});
           
			function complete(data){
			if (data.status==1)
			{
				window.location='__URL__/nchoicedetail';
             }else{
				$('#result').html(data.info).show();
             }
		}
	});
	</script>

</head>
<body>
<!-- layout::Auth:header::0 -->
    	<div class="container-fluid">
     		<div class="row-fluid">
  			  <!-- layout::Auth:leftmenu::0 -->
              	 <div class="span8">
                    <div class="hero-unit">
                        <h1>多选编辑</h1>
                        	  <p style="font-size:12px">当前位置：
                              <a href='__APP__/index/index' >主页</a>>
                              <a href='__URL__/index'>后台管理</a>>
                              <a href='__URL__/choose1' >测试管理</a>>
                              <a href='__URL__/choose2' >题库</a>>
                            <a href="__URL__/nchoiceadd">多选编辑</a>
                            </p>
                     </div>
                    <form id='form1' method="post" action="__URL__/nchoice_add" >
                                <select name="courseid">
                                    <option>所属课程</option>
                                    <?php if(is_array($cnlist)): $i = 0; $__LIST__ = $cnlist;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo1): ++$i;$mod = ($i % 2 )?><option value =	<?php echo ($vo1["id"]); ?>><?php echo ($vo1["name"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                                 </select>
                        <div id='result'></div>
                        <input type='hidden' name='no' value='<?php echo ($no); ?>'>
                        <input type='text' name='name' placeholder="题目"><br>
                        <select name="answer">
                            <option>标准答案</option>
                            <?php if(is_array($anlist)): $i = 0; $__LIST__ = $anlist;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo1): ++$i;$mod = ($i % 2 )?><option value =	<?php echo ($vo1); ?>><?php echo ($vo1); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                         </select><br>
                         <hr>
                        选项：<br>
                        A:<input type='text' name='A'><br>
                        B:<input type='text' name='B'><br>
                        C:<input type='text' name='C'><br>
                        D:<input type='text' name='D'><br>
                        
                        
                        <input name="submit" type="submit" value="添加" style="width:80px;" class="btn btn-success" >
                    </form>
</div>
</body>
</html>